package com.cdsf.kennedy.user;

import com.cdsf.common.conf.AbstractController;
import com.cdsf.common.exception.BusinessException;
import com.cdsf.common.util.BaseJson;
import com.cdsf.kennedy.user.domain.User;
import com.cdsf.kennedy.user.service.UserRoleService;
import com.cdsf.kennedy.user.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Author: kennedy
 * @Date: Created in 15:42 2018/2/6
 */
@RestController
@RequestMapping("/userrole")
@Api(tags = "用户角色管理")
public class UserRoleController extends AbstractController {
    @Autowired
    private UserRoleService userRoleService;

    @ApiOperation("用户角色分配")
    @PostMapping("/assignRoles")
    public BaseJson assignRoles(Map<String, Object> param) {
        BaseJson baseJson = new BaseJson();
        userRoleService.assignRoles(param);
        baseJson.setStatus(true);
        return baseJson;
    }
}
